<template>
  <div class="search-content">
    <div class="search-list" :class="{ toggleFlag : toggleFlag}">
      <slot></slot>
    </div>
    <!-- <div class="search-btn" :class="{toggleFlag: toggleFlag}">
      <div class="showOrHide" @click="toggleFlag = !toggleFlag">{{ toggleFlag?'展开':'收起' }}</div>
      <div class="searchBtn"><img src="~@/assets/action-bar-icon/search.png" @click="search" /></div>
    </div> -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      toggleFlag: true // false: 展开 true: 收起
    }
  },
  methods: {
    search() {
      this.$emit('search');
    }
  }
}
</script>

<style lang="scss" scoped>
@import "~@/styles/variables.scss";
.search-content{
  position: relative;
  display: flex;
  justify-content: space-between;
}
.search-list{
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  width: 100%;
  ::v-deep .common-search-item{
    margin-bottom: 10px;
    .label{
      // width: auto !important;
      // min-width: 0 !important;
    }
  }
  &.toggleFlag{
    flex-direction: row;
    ::v-deep .common-search-item{
      margin-right: 10px;
      &:nth-child(n+6){
        margin-top: 10px;
      }
    }
  }

}
.search-btn{
  width: 100px;
  flex-shrink: 0;
  margin-left: 20px;
  &.toggleFlag{
    display: flex;
    align-items: center;
    width: 120px;
    .searchBtn{
      margin-top: 0;
      margin-left: 10px;
    }
  }
  .showOrHide{
    cursor: pointer;
    text-align: center;
    font-size: 16px;
    &:hover{
      color: $tagsViewActiveBgColor;
    }
  }
  .searchBtn{
    margin: 10px auto 0;
    img{
      display: block;
      margin: 0 auto;
    }
  }
}
</style>
